import Vue from 'vue'

const EventBus = new Vue({
  data() {
    return {}
  },
  computed: {},
  methods: {
    emit(event, ...args) {
      console.log('eventBus:emit', event, args)
      this.$emit(event, ...args)
    },
    on(event, callback) {
      console.log('eventBus:on', event)
      this.$on(event, callback)
    },
    off(event, callback) {
      this.$off(event, callback)
    }
  }
})
export default EventBus
